package com.zn.kjj.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Collections;
import java.util.Enumeration;
import java.util.Properties;
import java.util.ResourceBundle;
import java.util.Set;

/**
 * @ClassName: XMLResourceBundle
 * @Description: XML资源文件类
 * @author w15579
 * @version v1.0.0
 */
public class XMLResourceBundle extends ResourceBundle {

    /**
     * 属性
     */
    private Properties props;
    XMLResourceBundle(InputStream stream) throws IOException {
        props = new Properties();
        props.loadFromXML(stream);
    }
    /**
     * get
     * @param key .
     * @return .
     */
    @Override
    protected Object handleGetObject(String key) {
        return props.getProperty(key);
    }
    /**
     * get
     * @return .
     */
    @Override
    public Enumeration<String> getKeys() {
        Set<String> handleKeys = props.stringPropertyNames();
        return Collections.enumeration(handleKeys);
    }

}
